#include <stdio.h>

#include "lemp.h"

lemp_handle_t event_hander;



char* name = "open";

void open_cb(void* args)
{
	if (args != NULL)
		printf("open_cb%s\n", args);
	else
		printf("open_cb\n");
}

void open_cb1(void* args)
{
	if (args != NULL)
		printf("open_cb1%s\n", args);
	else
		printf("open_cb1\n");
}

char* args = "dsfdshfsdhfjdhkg";

int main()
{
	lemp_init(&event_hander);

	lemp_event_cb_regester(&event_hander, name, strlen(name), open_cb, LEMP_EVENT_TIMES_ONCE);

	lemp_event_cb_regester(&event_hander, name, strlen(name), open_cb1, LEMP_EVENT_TIMES_LOOP);

	lemp_event_emit(&event_hander, name, strlen(name), args);

	lemp_event_cb_delete(&event_hander, name, strlen(name), open_cb);

	lemp_event_emit(&event_hander, name, strlen(name), args);

	return 0;
}